1. Technical Field
The present invention is directed to an apparatus and method for maintaining object associations in an object oriented environment. In particular, the present invention is directed to an apparatus and method for maintaining object associations at both ends of the association with a minimal amount of code required.
2. Description of Related Art
In object oriented design, two classes can be related using an association which has cardinalities on each end. For example, an Employee has an address and a single Employee (cardinality 1) has one or more Addresses (cardinality 1 . . . n). Typically, the Employee object keeps a list of addresses in a collection class, such as a Java vector. It is also possible that the Address object may keep a reference to the Employee that owns it.
It can be seen that there are four possible combinations of object association cardinalities: one to one; one to many; many to one, and many to many. In order to handle all of these possible object associations, the amount of code necessary to perform each association and update each association may become extremely large and unmaintainable. Thus, it would be beneficial to have an apparatus and method for maintaining object associations in an object oriented environment in which the amount of code necessary to handle each possible combination of object association cardinalities is minimized.